import React from "react";
import { actionCreators } from "../../page/login/store";
import { connect } from 'react-redux';
import {fromJS} from 'immutable';
class Footer extends React.Component {
  render() {
    let { isLogin, quitHandle } = this.props
    return isLogin ? <div
      onClick={() => {
        quitHandle()
      }}
      style={{
        width: "90%",
        background: "#fff",
        margin: "10px auto",
        padding: "15px",
        borderRadius: "4px",
        color: "#fff",
        textAlign: "center",
        backgroundColor: "#4d4dd6"
      }}>
      退出
    </div> : ""
  }
}
const mapStateToProps = (state, ownProps) => {
    state= fromJS(state);
  return {
    isLogin: state.getIn(["login", 'isLogin']),
  };
};
const mapDispatchToProps = (dispatch, ownProps) => {
  return {
    quitHandle() {
      dispatch(actionCreators.quitHandle());
    },
  };
};
export default connect(mapStateToProps, mapDispatchToProps)(Footer)
